package com.qf.hospital.service.impl;

import com.qf.hospital.mapper.DoctorMapper;
import com.qf.hospital.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author ASUS
 * @version V1.0
 * @Project hospital
 * @Package com.qf.hospital.service.impl
 * @Date 2021/10/19 18:38
 */
@Service
public class DoctorServiceImpl implements DoctorService{

    @Autowired
    private DoctorMapper doctorMapper;

    /**
     * 查询首页排班信息
     * @param week
     * @return
     */
    @Override
    public List<Map<String, Object>> findSchedulerByWeek(String week) {
        List<String> list = doctorMapper.selectDoctorNameBySchedulerAndWeek(week);
        List<Map<String, Object>> result = new ArrayList<>();
        for (String doctorName : list) {
            HashMap<String, Object> map = new HashMap<>();
            map.put("doctorName",doctorName);
            result.add(map);
        }
        return result;
    }

}
